<?php include_once '../Model/usuarioDao.php';?>
<?php

$firstName=$_POST['firstName'];
$middleName=$_POST['middleName'];
$lastName=$_POST['lastName'];
$rol=$_POST['rol'];
$department=$_POST['department'];
$company=$_POST['company'];
$mail=$_POST['mail'];
$user=$_POST['user'];
$userName=$_POST['userName'];
$password=$_POST['passWord'];

$accion=$_POST['accion'];

//echo $userName;
//echo $password;
//echo 'Entre...';
//echo $accion;

if(strcmp($accion,"1")==0){
//Para modificar

    //$result = modificarUsuario2($firstName,$middleName,$lastName,$rol,$department,$company,$mail,$user,$userName,$password);
    $result = modificarUsuario2($firstName,$middleName,$lastName,$rol,$department,$company,$mail,$user,$userName);

    header('Location: ../Menu/usuarios.php?us='.'n'.'');
}
else{
    $result = insertarUsuario($userName,$password,$firstName,$middleName,$lastName,$rol,$department,$company,$mail,$user);
    header('Location: ../Menu/usuarios.php?us='.'n'.'');
    
}

